﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EasyStep.Attributes;
using EasyStep.TestExecution.Data;
using EasyStep.TestExecution.Interfaces;
using OpenQA.Selenium;
using Microsoft.VisualStudio.TestTools.UnitTesting;



namespace EasyStep.TestActions.Actions
{
    [TestAction(typeof(AssertAction), Name = "ValueByXpath", RequireData = true, RequireLocator = true)]
    class AssertValueByXpath : ITestAction<IWebDriver>
    {
        public void Execute(IWebDriver browser, TestStepResult data, IExecuteDataContext context)
        {
            var element = browser.FindElement(By.XPath(data.Locator)).Text;
            Assert.AreEqual(element, data.Data);
        }
    }
}